package com.springsummer.information.green.hello;

import com.alibaba.fastjson.JSON;
import com.springsummer.information.green.annotation.Controller;
import com.springsummer.information.green.annotation.RequestMapping;
import com.springsummer.information.green.annotation.ResponseBody;


@Controller
public class HelloUserController {


    @RequestMapping(path = "/helloUser/helloModel")
    @ResponseBody
    public UserVo helloModel(String name, Integer age, String phone){
        UserVo userVo=new UserVo();
        userVo.setName("controller:"+name);
        userVo.setAge(age);
        userVo.setPhone("controller:"+phone);
        System.out.println(getClass().getName()+" helloModel model:"+ JSON.toJSONString(userVo));
        return userVo;
    }

    @RequestMapping(path = "/helloUser/helloUserTwo")
    @ResponseBody
    public UserVo helloUserTwo(String name, Integer age, String phone){
        UserVo userVo=new UserVo();
        userVo.setName("helloTwo:"+name);
        userVo.setAge(age);
        userVo.setPhone("helloTwo:"+phone);
        System.out.println(getClass().getName()+" helloUserTwo model:"+ JSON.toJSONString(userVo));
        return userVo;
    }

}
